<!--
  Generated template for the StoresPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>
    <ion-navbar color="orange">
        <ion-title>
            门店库
        </ion-title>
    </ion-navbar>
</ion-header>

<ion-content padding>
    <div class="ht-overflow ht-background ht-margin-bottom ht-padding-top10" padding-left padding-right *ngFor="let group of options">
        <!-- 工种 -->
        <div *ngFor="let item of group">
            <div class="ht-100 ht-overflow ht-font-13 flex" [ngStyle]="{'display':item.num < 9 ? 'flex':'none'}">
                <div class="ht-999 ht-line-25 nowrap">
                    {{item.option_name}}：
                </div>
                <!--0文本框-->
                <div class="" *ngIf="item.option_type === 0">
                    <div class="ht-100 ht-overflow ht-padding-bottom10">
                        <input type="text" class="ie-input" placeholder="{{item.option_holder}}" [(ngModel)]="infoData[item.letter]" (blur)="textData(item)">
                    </div>
                </div>
                <!--2单选-->
                <div class="ht-padding-bottom10" *ngIf="item.option_type === 2">
                    <div class="ht-100 ht-overflow ht-padding-bottom10">
                        <label class="ie-bs" [ngClass]="{'ie-xiaoguo':option.list_name == infoData[item.letter]}" *ngFor="let option of item.option_list">
                            <input type="radio" value="{{option.list_name}}" [(ngModel)]="infoData[item.letter]" hidden (click)="selRadioData(item,option)"> {{option.list_name}}
                        </label>
                        <!--<input type="text" class="ie-input" placeholder="{{item.option_holder}}" [(ngModel)]="this.infoTextData[item.letter]" (blur)="textData(item)">-->
                    </div>
                </div>
                <!--3多选-->
                <div class="ht-padding-bottom10" *ngIf="item.option_type === 3">
                    <div class="ht-100 ht-overflow ht-padding-bottom10">
                        <label class="ie-bs" [ngClass]="{'ie-xiaoguo':util.inArray(infoData[item.letter],option.list_name) > -1}" *ngFor="let option of item.option_list"
                            (click)="selCheckData(item,option)">
                            {{option.list_name}}
                        </label>
                        <!--<input type="text" class="ie-input" placeholder="{{item.option_holder}}" [(ngModel)]="infoTextData[item.letter]" (focus)="checkFocusData(item)" (blur)="checkBlurData(item)">-->
                    </div>
                </div>
                <!--1文本域-->
                <div class="ht-padding-bottom10 flex-1" *ngIf="item.option_type === 1">
                    <textarea rows="3" placeholder="{{item.option_holder}}" style="width:100%;" [(ngModel)]="infoData[item.letter]" (blur)="textData(item)"></textarea>
                </div>
                <!--4 时间-->
                <!--5文件上传-->
                <div class="ht-padding-bottom10 flex flex-wrap" *ngIf="item.option_type === 5">
                    <div class="ie-img margin-left-5 margin-bottom-5 ht-relative" *ngFor="let image of infoData[item.letter]">
                        <img [src]="config.imageUrl+image" style="width:100px;height:100px;">
                        <span class="del-image" (click)="delImage(item,image)">删除</span>
                    </div>
                    <div class="ie-img margin-left-5 margin-bottom-5" *ngIf="infoData[item.letter] == undefined || infoData[item.letter].length < 3">
                        <input type="file" class="file-input" (change)="uploadImage(item,$event)">
                    </div>
                </div>
                <!--6 时间范围-->
                <div class="ht-100" style="height:30px;background:#f8f8f8;margin-bottom:15px;padding-left:10px;padding-top:3px;" *ngIf="item.option_type === 6">
                    <div class="flex-1 ht-100 ht-overflow ht-relative padding-top-5 ht-font-14">
                        <ion-datetime style="line-height:35px;" (ionChange)="selDate(item,$event)" [(ngModel)]="infoData[item.letter]" placeholder="{{item.option_holder}}"
                            no-padding displayFormat="YYYY年MM月DD日" doneText="完成" cancelText="取消"></ion-datetime>
                    </div>
                </div>

            </div>

        </div>
    </div>
</ion-content>

<ion-footer>
    <ion-toolbar>
        <div class="ht-50 ht-float-left ht-line-50 ht-text-center" (click)="resetData()">重置</div>
        <div class="ht-50 ht-float-left ht-line-50 ht-text-center ht-fff ht-f29603" (click)="submitData()">
            确认
        </div>
    </ion-toolbar>
</ion-footer>